package com.xiaoyezi.demo2.base;

import lombok.Data;


@Data
public class Status{
    public static final String success = "0";
    public static final String error = "-1";

    private String code;
    private Object data;
    private Object msg;

    public static Status success(){
        Status s = new Status();
        s.setCode(success);
        s.setData("OK");
        s.setMsg("OK");
        return s;
    }
    public static Status success(Object data){
        Status s = new Status();
        s.setCode(success);
        s.setData(data);
        s.setMsg("OK");
        return s;
    }

    public static Status error(Object msg){
        Status s = new Status();
        s.setCode(error);
        s.setData("null");
        s.setMsg(msg);
        return s;
    }
        
}


